function $_(obj)
{
	return document.getElementById(obj);
}

function getOuterHTML(obj)
{
	var div = document.createElement('div');
	div.appendChild(obj.cloneNode(1));
	return div.innerHTML;
}

function load_admin()
{
	load('view/js/admin.js.css');
	load('js.php?p=admin');
}

function load_login()
{
	load('view/js/login.js.css');
	load('js.php?p=login');
}

function load(url,css)
{
	var ext = url.substring(url.length-4,url.length);
	var head = document.getElementsByTagName('head');
	head = head[0];
	if (ext.toLowerCase() == '.css' || css)
	{
		var dom = document.createElement('link');
		dom.rel = "stylesheet";
		dom.href = url;
	}
	else 
	{
		var dom = document.createElement('script');
		dom.src = url;
	}
	head.appendChild(dom);
}

function get_value_from_url(url,key)
{
	eval('var re = /'+key+'=([^&]*)/;');
	re = re.exec(url);
	if (re) return re[1];
}
